# from redis import Redis
#
# redis = Redis.from_url("redis://127.0.0.1:6379/0")
# redis.set('username', 'xiaohuihui')
# username = redis.get('username')
# print(username.decode())

import string, secrets
def genint(length: int = 4) -> str:
    """
    生成指定长度的纯数字字符串
    @param length: 字符长度
    return
    """
    characters = string.digits
    ret = "".join(secrets.choice(characters) for i in range(length))
    return ret


"""
fastAPI -> async/await[异步函数] -> 协程 -> 生成器 -> 生成器函数 -> yield/await[可以返回结果结果，每一次返回结果都是使用同一个内存]
"""

if __name__ == '__main__':
    for i in range(1000):
        print(genint(4))


